<%--
  Created by IntelliJ IDEA.
  User: 骆鹏
  Date: 2017/7/25
  Time: 10:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@taglib prefix="mvc" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://www.springframework.org/tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<head>
    <title>人员调度历史信息</title>


    <link rel="stylesheet" href="/css/officialDocument/officialDocument.css">
    <link rel="stylesheet" href="/lib/layer/skin/default/layer.css">
    <link rel="stylesheet" type="text/css" href="../lib/pagination/style/pagination.css"/>
    <link rel="stylesheet" href="/lib/laydate/need/laydate.css">
    <link rel="stylesheet" href="/css/base.css">
    <script src="/js/common/language.js"></script>
    <script type="text/javascript" src="/js/jquery/jquery-1.9.1.js"></script>
    <script src="/js/jquery/jquery.cookie.js"></script>
    <script src="/lib/layer/layer.js?20201106"></script>
    <script src="/js/base/base.js"></script>
    <script src="/lib/laydate/laydate.js"></script>
    <script type="text/javascript" src="/js/base/tablePage.js"></script>
    <script src="/lib/pagination/js/jquery.pagination.min.js" type="text/javascript" charset="utf-8"></script>
    <style>
        /*!*.tr_bg td{
            border: 1px #dddddd solid;
            background: #fff;
        }*!
        .tdxx tr td{
            border: 1px solid #dddddd ;
        }
        .tr_bg td{
            background: #f2f2f2;
        }
        !*tr .bg{
            background: #f2f2f2;
            border: 1px #dddddd solid;
        }*!
        table tbody tr:hover {
            background: #f2f2f2;
        }
        th{
            border: 1px solid #dddddd;
        }*/
        .tableBlock {
            border: 1px #dddddd solid;
            line-height: 20px;
            font-size: 9pt;
            border-collapse: collapse;
        }
        tr {
            display: table-row;
            vertical-align: inherit;
            border-color: inherit;
        }
        /*td {*/
            /*font: 9pt "微软雅黑";*/
        /*}*/
        .big{
            font-size: 12pt;
            color: #124164;
            font-weight: bold;
        }
        .tableHeader{
            height: 30px;
            background: #ffffff;
            font-weight: bold;
            color: #383838;
            line-height: 23px;
            padding: 0px 0px 0px 5px;
            font-size: 10pt;
            border-bottom: 1px #dddddd solid;
            text-align: left;
        }
        .tableContent{
            background: #f2f2f2;
            border: 1px #dddddd solid;
            padding: 3px;
            height: 30px;
            text-align: left;
        }
        .tableData{
            background: #FFFFFF;
            border-bottom: 1px #dddddd solid;
            border-top: 1px #dddddd solid;
            border-right: 1px #dddddd solid;
            padding: 3px;
            height: 30px;
            text-align: left;
        }
    </style>
</head>
<body>
    <table align="center" class="tableBlock" style="width:80%;">
        <thead>
            <tr>
                <td colspan="6"><span class="big">人员调度历史调度信息</span><span style="font-size: 10pt;">( 红色为原岗位 , 绿色为调度后岗位 )</span></td>
            </tr>
        </thead>
        <tbody>

        </tbody>
        <tfoot>

        </tfoot>
    </table>
</body>
<script type="text/javascript">
    $(function () {
        var href = window.location.href;
        var staffId = href.substring(href.indexOf('=')+1,href.indexOf('&'));
        var userId = href.substr(href.lastIndexOf('=')+1);
        $.ajax({
          url: '/hrPersonnelScheduling/selectHrDispatcherDetails',
          type: 'get',
          data: {
              staffId:staffId,
              userId:userId
          },
          dataType: 'json',
          success: function (res) {
              function checkInner(obj) {
                  if (obj == "" || typeof (obj) == "undefined") {
                      return " ";
                  } else if (obj.indexOf(",")>0) {
                      var i = obj.indexOf(",");
                      var oldObj = obj.substr(0,i);
                      var newObj = obj.substr(i+1);
                      return "<span style='color: red;'>"+oldObj + "</span> --> <span style='color: green;'>" + newObj + "</span>";
                  } else {
                      return obj;
                  }
              }
              function checkObjectStr(data){
                  if (data == "" || typeof (data) == "undefined") {
                      return "";
                  }else {
                      return data;
                  }
              }
              var objectStr = "<tr><td colspan='6' class='tableHeader'>当前调度信息</td></tr>" +
                              "<tr>" +
                                  "<td class='tableContent'>姓名：</td>" +
                                  "<td class='tableData'>" + checkObjectStr(res.object['staffName']) + "</td>" +
                                  "<td class='tableContent'>部门：</td>" +
                                  "<td class='tableData'>" + checkObjectStr(res.object['deptName']) + "</td>" +
                                  "<td class='tableContent'>当前职务：</td>" +
                                  "<td class='tableData'>" + checkObjectStr(res.object['jobPositionStr']) + "</td>" +
                              "</tr>" +
                              "<tr>" +
                                  "<td class='tableContent'>所在项目：</td>" +
                                  "<td class='tableData'>" + checkObjectStr(res.object['projectNAME']) + "</td>" +
                                  "<td class='tableContent'>当前岗位：</td>" +
                                  "<td class='tableData'>" + checkObjectStr(res.object['workJobStr']) + "</td>" +
                                  "<td class='tableContent'>所在位置：</td>" +
                                  "<td class='tableData'>" + checkObjectStr(res.object['locationAddressName']) + "</td>" +
                              "</tr>";

              var objStr = "<tr><td colspan='6' class='tableHeader'>历史调度信息</td></tr>";
              for (var x = 0; x < res.obj.length; x++) {
                  objStr += "<tr>" +
                              "<td class='tableContent'>调度时间：</td>"+
                              "<td class='tableData'>"+checkInner(res.obj[x]['updateTime'])+"</td>" +
                              "<td class='tableContent'>调度人：</td>"+
                              "<td class='tableData'>"+checkInner(res.obj[x]['createrName'])+"</td>" +
                              "<td class='tableContent'>所在位置：</td>" +
                              "<td class='tableData'>"+checkInner(res.obj[x]['locationAddressName'])+"</td>" +
                          "</tr>" +
                          "<tr>" +
                              "<td class='tableContent'>职务：</td>" +
                              "<td class='tableData'>"+checkInner(res.obj[x]['jobPositionName'])+"</td>" +
                              "<td class='tableContent'>项目：</td>" +
                              "<td class='tableData'>"+checkInner(res.obj[x]['projectName'])+"</td>" +
                              "<td class='tableContent'>岗位：</td>" +
                              "<td class='tableData'>"+checkInner(res.obj[x]['workJobName'])+"</td>" +
                          "</tr>" ;
                          /*"<tr>" +
                              "<td class='tableContent'>所在位置：</td>" +
                              "<td class='tableData'>"+checkInner(res.obj[x]['locationAddressName'])+"</td>" +
                              "<td class='tableContent'>考核分数：</td>" +
                              "<td class='tableData'>"+checkInner(res.obj[x]['assessScore'])+"</td>" +
                              "<td class='tableContent'>考核评价：</td>" +
                              "<td class='tableData'>"+checkInner(res.obj[x]['assessment'])+"</td>\n" +
                          "</tr>";*/
              }
              $("tbody").html(objectStr);
              $("tfoot").html(objStr);
          }
        })
    });
</script>
</html>